import {Column, Entity, PrimaryGeneratedColumn} from "typeorm";

@Entity("approval_record", { schema: "workflow" })
export class CreateApprovalDto {
    @Column("char", { primary: true, name: "id", length: 36 })
    @PrimaryGeneratedColumn("uuid")
    id: string;

    @Column("varchar", { name: "name", comment: "流程名称", length: 50 })
    name: string|null;

    @Column("tinyint", {
        name: "del_flag",
        nullable: true,
        comment: "删除标志符",
        default: () => "'1'",
    })
    delFlag: number | null;

    @Column("tinyint", {
        name: "status",
        nullable: true,
        comment: "状态",
        default: () => "'0'",
    })
    status: number | null;

    @Column("json", {
        name: "form_data",
        nullable: true,
        comment: "表单定义JSON数据",
    })
    formData: object | null;

    @Column("json", {
        name: "approval_data",
        nullable: true,
        comment: "流程定义JSON数据",
    })
    approvalData: object | null;

    @Column("varchar", {
        name: "create_by",
        nullable: true,
        comment: "创建人",
        length: 50,
    })
    createBy: string | null;

    @Column("varchar", {
        name: "creator",
        nullable: true,
        comment: "创建人",
        length: 50,
    })
    creator: string | null;

    @Column("datetime", {
        name: "create_time",
        nullable: true,
        comment: "创建日期",
    })
    createTime: Date | null;

    @Column("varchar", {
        name: "update_by",
        nullable: true,
        comment: "更新人",
        length: 50,
    })
    updateBy: string | null;

    @Column("datetime", {
        name: "update_time",
        nullable: true,
        comment: "更新日期",
    })
    updateTime: Date | null;
}
